Skip to content

查询路径是否受保护 - ProtectFileQueryProtectedPath

函数简介

查询路径是否受保护。(高级版功能,普通版无法使用)

接口名称

ProtectFileQueryProtectedPath

DLL调用

c
int32_t ProtectFileQueryProtectedPath(int64_t instance, string path, int32_t* mode);

参数说明

参数名类型说明
instance长整数型OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。
path字符串要查询的文件或文件夹路径。
mode整数型指针输出参数,用于接收该路径的保护模式(可为NULL)。

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int ret = ola.ProtectFileQueryProtectedPath("C:\\test.txt", "value");
csharp
using OLAPlug;

var ola = new OLAPlugServer();
int ret = ola.ProtectFileQueryProtectedPath("C:\\test.txt", "value");
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
ret = ola.ProtectFileQueryProtectedPath("C:\\test.txt", "value")
java
import com.olaplug.OLAPlugServer;

OLAPlugServer ola = new OLAPlugServer();
int ret = ola.ProtectFileQueryProtectedPath("C:\\test.txt", "value");
cpp
var ola = com("OlaPlug.OlaSoft")
var ret = ola.ProtectFileQueryProtectedPath("C:\\test.txt", "value")
vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
ret = ola.ProtectFileQueryProtectedPath("C:\\test.txt", "value")
text
.局部变量 ola, OLAPlug
ola.创建 ()
ret = ola.ProtectFileQueryProtectedPath(“C:\\test.txt”, “value”)
aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var ret = ola.ProtectFileQueryProtectedPath("C:\\test.txt", "value");
text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
整数 ret = ola.ProtectFileQueryProtectedPath("C:\\test.txt", "value")
cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int32_t ret = ola.ProtectFileQueryProtectedPath("C:\\test.txt", "value");

原生 DLL 调用

cpp
ProtectFileQueryProtectedPath(instance, "C:\\test.txt", 0);
csharp
using System.Runtime.InteropServices;
using System.Text;

[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern int ProtectFileQueryProtectedPath(long ola, string path, int mode);

ProtectFileQueryProtectedPath(instance, "C:\\test.txt", 0);
python
from ctypes import CDLL, c_int, c_int64, create_string_buffer

ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
ola.ProtectFileQueryProtectedPath(instance, "C:\\test.txt", 0)

返回值

1 路径受保护,0 路径未受保护或查询失败。

注意事项

  • 需要驱动支持与管理员权限。
  • mode 参数可为NULL,如果不需要获取保护模式。